﻿@model List<MMITWeb.Models.AccountTransactionsViewModel>

@{
    ViewBag.Title = "Accounts: List";
}

<div id="page" class="container">
<h2>My Accounts</h2>

@(Html.Telerik().Grid(Model).Name("Accounts")
                            .DataKeys(keys => keys.Add(o => o.Account.Id))
                            .Columns(columns => 
                                {
                                    columns.Bound(o => o.Account.Name).Title("Account Name");
                                    columns.Bound(o => o.Account.AccountType.Name).Title("Account Type");
                                    columns.Bound(o => o.Account.Currency.Name).Title("Currency");
                                    columns.Bound(o => o.Account.ActualBalance);
                                    columns.Bound(o => o.Account.AvailableBalance);
                                    columns.Bound(o => o.Account.coreStatus).Title("Status");   
                                }
                             )
                             .DetailView(detailview => 
                                            detailview.Template(
                                                        @<text>
                                                              @(Html.Telerik().Grid(item.Transactions).Name("Transactions")
                                                              .Columns(columns =>
                                                                  {
                                                                      columns.Bound(o => o.TransactionCode).Title("TransactionRef");
                                                                      columns.Bound(o => o.TransactionType.Name).Title("Transaction Type");
                                                                      columns.Bound(o => o.Amount);
                                                                      columns.Bound(o => o.Sender.Currency.Name).Title("Currency");
                                                                      columns.Bound(o => o.Recipient.Name).Title("Recipient");
                                                                      columns.Bound(o => o.TimeInitiated);
                                                                      columns.Bound(o => o.coreStatus).Title("Status");                                                
                                                                  }
                                                              )
                                                                .Pageable(pageable => pageable.Enabled(true))
                                                                .Filterable(filterable => filterable.Enabled(true))
                                                                .Groupable(groupable => groupable.Enabled(true))
                                                                .Footer(true)
                                                              )
                                                        </text>
                                                                )
                                         
                                             
                             )
                             .Pageable(pageable => pageable.Enabled(true))
                             .Filterable(filterable => filterable.Enabled(true))
                             .Groupable(groupable => groupable.Enabled(true))
                             .Footer(true) 
                          )
</div>